import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
import * as _path from 'path'

// https://vitejs.dev/config/
export default defineConfig({
    server: {
        //port: 8080,
        open: true,
        https: false,
        proxy: {
            '/api': {
                //target: loadEnv(mode, process.cwd().VITE_APP_BASE_URL) || 'http://localhost:9000/',
                target: 'http://localhost:9000/',
                changeOrigin: true,
                rewrite: (fullPathStr) => fullPathStr.replace(/^\/api/, '')
            }
        },
        hmr: {
            overlay: false,
        }
    },
    resolve: {
        alias: {
            "@": _path.resolve(__dirname, "src"),
            "@assets": _path.resolve(__dirname, "src/assets"),
        }
    },
    build: {
        chunkSizeWarningLimit: 15000,
    },
    plugins: [
        vue(),
    ],
})
